package com.springboot.tr.task;

import java.util.HashMap;
import java.util.Map;

/**
 * 网证查询业务服务响应结果code对应massage枚举类
 *
 * @auther: zhengzhenzhuang
 * @date: 2021/1/6 16:43
 */
public enum LevelEnum {
    /*LEVEL1(1,10),
    LEVEL2(2,30),
    LEVEL3(3,60),
    LEVEL4(4,120),
    LEVEL5(5,240),
    LEVEL6(6,360),
    LEVEL7(7,560);*/


    LEVEL1(1,1),
    LEVEL2(2,1),
    LEVEL3(3,1),
    LEVEL4(4,1),
    LEVEL5(5,1),
    LEVEL6(6,1),
    LEVEL7(7,1);



    private static final Map<Integer, Integer> LEVEL_QUERY_MAP;
    private int level;
    private int minute;

    LevelEnum(int level, int minute) {
        this.level = level;
        this.minute = minute;
    }

    //初始化LEVEL_QUERY_MAP
    static {
        LEVEL_QUERY_MAP = new HashMap<>();
        for (LevelEnum levelEnum : LevelEnum.values()) {
            LEVEL_QUERY_MAP.put(levelEnum.getLevel(), levelEnum.getMinute());
        }
    }
    public static int getLevelMinute(int level) {
        return LEVEL_QUERY_MAP.get(level);
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getMinute() {
        return minute;
    }

    public void setMinute(int minute) {
        this.minute = minute;
    }
}
